<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--歌手信息--%>
<ul class="artistBox">
<c:forEach items="${singers}" var="s">
        <li>
            <div class="artistTop">
                <a href="/singer/selectSingerById?sId=${s.sId}" class="artistLeft fl">
                    <img src="${s.sImg}">
                </a>
                <div class="artistRight fr">
                    <div class="artistNav">
                        <a class="active" href="javascript:void(0);">热歌</a>
                        <a href="javascript:void(0);">新歌</a>
                        <a href="javascript:void(0);">专辑</a>
                    </div>
                    <ul class="hotList">
                        <c:forEach items="${musics}" var="music">
                            <c:forEach items="${music}" var="m" varStatus="st">
                                <c:if test="${s.sId == m.artistId}">
                                    <c:set var="songName" value="${m.songName}"></c:set>
                                    <c:choose>
                                        <c:when test="${fn:length(songName) > 5}">
                                            <li><a href="/lyrics/getLyrics?musicRid=${m.musicRid}">${st.index+1}.${fn:substring(songName,0,5)}...</a></li>
                                        </c:when>
                                        <c:otherwise>
                                            <li><a href="/lyrics/getLyrics?musicRid=${m.musicRid}">${st.index+1}.${m.songName}</a></li>
                                        </c:otherwise>
                                    </c:choose>
                                </c:if>
                            </c:forEach>
                        </c:forEach>
                    </ul>
                </div>
            </div>
            <a href="javascript:void(0);" class="a_name">${s.sName}</a>
        </li>
</c:forEach>
</ul>
    <%--分页按钮--%>
<div class="pageComment">
    <!--上一页按钮-->
    <a id="prePage" href="javascript:void(0);" onclick="selectSinger(null,${singerPage.currentPage - 1})">
        <img src="../image/prev.png">
    </a>
    <!--具体页数按钮-->
    <%--<c:choose>--%>
        <%--<c:when test="${singerPage.currentPage == singerPage.totalPage}">--%>
            <%--<a href="javascript:void(0);" <c:if test="${1 == singerPage.currentPage}">class="current"</c:if>--%>
               <%--onclick="selectSinger(null,${singerPage.totalPage})">1</a>--%>
            <%--<span class="point">...</span>--%>
            <%--<c:choose>--%>
                <%--<c:when test="${singerPage.totalPage <= 5}">--%>
                    <%--<c:forEach begin="1" end="${singerPage.totalPage}" varStatus="st">--%>
                        <%--<a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>--%>
                           <%--onclick="selectSinger(null,${st.index})">${st.index}</a>--%>
                    <%--</c:forEach>--%>
                <%--</c:when>--%>
                <%--<c:otherwise>--%>
                    <%--<c:set var="beginIndex2" value="${singerPage.currentPage}" scope="session"></c:set>--%>
                    <%--<c:set var="endIndex2" value="${singerPage.totalPage}" scope="session"></c:set>--%>
                    <%--&lt;%&ndash;<c:choose>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<c:when test="${singerPage.currentPage == endIndex2}">&ndash;%&gt;--%>
                            <%--<c:set var="beginIndex2" value="${singerPage.currentPage}" scope="session"></c:set>--%>
                            <%--<c:set var="endIndex2" value="${endIndex2 - 4}" scope="session"></c:set>--%>
                            <%--<c:forEach begin="${endIndex2}" end="${beginIndex2}" varStatus="st">--%>
                                <%--<a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>--%>
                                   <%--onclick="selectSinger(null,${st.index})">${st.index}</a>--%>
                            <%--</c:forEach>--%>
                        <%--&lt;%&ndash;</c:when>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<c:otherwise>&ndash;%&gt;--%>
                            <%--&lt;%&ndash;<c:forEach begin="${beginIndex2}" end="${endIndex2}" varStatus="st">&ndash;%&gt;--%>
                                <%--&lt;%&ndash;<a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>&ndash;%&gt;--%>
                                   <%--&lt;%&ndash;onclick="selectSinger(null,${st.index})">${st.index}</a>&ndash;%&gt;--%>
                            <%--&lt;%&ndash;</c:forEach>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;</c:otherwise>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;</c:choose>&ndash;%&gt;--%>
                <%--</c:otherwise>--%>
            <%--</c:choose>--%>
        <%--</c:when>--%>
        <%--<c:otherwise>--%>
            <%--<c:choose>--%>
                <%--<c:when test="${singerPage.totalPage <= 5}">--%>
                    <%--<c:forEach begin="1" end="${singerPage.totalPage}" varStatus="st">--%>
                        <%--<a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>--%>
                           <%--onclick="selectSinger(null,${st.index})">${st.index}</a>--%>
                    <%--</c:forEach>--%>
                <%--</c:when>--%>
                <%--<c:otherwise>--%>
                    <%--<c:choose>--%>
                        <%--<c:when test="${singerPage.currentPage == endIndex}">--%>
                            <%--<c:set var="beginIndex" value="${singerPage.currentPage}" scope="session"></c:set>--%>
                            <%--<c:set var="endIndex" value="${endIndex + 4}" scope="session"></c:set>--%>
                            <%--<c:forEach begin="${beginIndex}" end="${endIndex}" varStatus="st">--%>
                                <%--<a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>--%>
                                   <%--onclick="selectSinger(null,${st.index})">${st.index}</a>--%>
                            <%--</c:forEach>--%>
                        <%--</c:when>--%>
                        <%--<c:otherwise>--%>
                            <%--<c:forEach begin="${beginIndex}" end="${endIndex}" varStatus="st">--%>
                                <%--<a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>--%>
                                   <%--onclick="selectSinger(null,${st.index})">${st.index}</a>--%>
                            <%--</c:forEach>--%>
                        <%--</c:otherwise>--%>
                    <%--</c:choose>--%>
                    <%--<span class="point">...</span>--%>
                    <%--<a href="javascript:void(0);" <c:if test="${singerPage.totalPage == singerPage.currentPage}">class="current"</c:if>--%>
                       <%--onclick="selectSinger(null,${singerPage.totalPage})">${singerPage.totalPage}</a>--%>
                <%--</c:otherwise>--%>
            <%--</c:choose>--%>
        <%--</c:otherwise>--%>
    <%--</c:choose>--%>


    <c:choose>
        <c:when test="${singerPage.totalPage <= 5}">
            <c:forEach begin="1" end="${singerPage.totalPage}" varStatus="st">
                <a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>
                   onclick="selectSinger(null,${st.index})">${st.index}</a>
            </c:forEach>
        </c:when>
        <c:otherwise>
            <c:choose>
                <c:when test="${singerPage.currentPage == endIndex}">
                    <c:set var="beginIndex" value="${singerPage.currentPage}" scope="session"></c:set>
                    <c:set var="endIndex" value="${endIndex + 4}" scope="session"></c:set>
                    <c:forEach begin="${beginIndex}" end="${endIndex}" varStatus="st">
                        <a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>
                           onclick="selectSinger(null,${st.index})">${st.index}</a>
                    </c:forEach>
                </c:when>
                <c:otherwise>
                    <c:forEach begin="${beginIndex}" end="${endIndex}" varStatus="st">
                        <a href="javascript:void(0);" <c:if test="${st.index == singerPage.currentPage}">class="current"</c:if>
                           onclick="selectSinger(null,${st.index})">${st.index}</a>
                    </c:forEach>
                </c:otherwise>
            </c:choose>
            <span class="point">...</span>
            <a href="javascript:void(0);" <c:if test="${singerPage.totalPage == singerPage.currentPage}">class="current"</c:if>
               onclick="selectSinger(null,${singerPage.totalPage})">${singerPage.totalPage}</a>
        </c:otherwise>
    </c:choose>
    <!--下一页按钮-->
    <a id="nextPage" href="javascript:void(0);" onclick="selectSinger(null,${singerPage.currentPage + 1})">
        <img src="../image/next.png">
    </a>
</div>


